#!/usr/bin/python
# coding: utf-8

try:
    r = 100 / 0
    print("result is %s" % r)
except ValueError as e:
    print("ValueError: ", e)
except ZeroDivisionError as e:
    print("ZeroDivisionError: ", e)
except BaseException as e:
    print("BaseException: ", e)
finally:
    pass

print("--------------------------")

def cal(m,n):
    if(n==0):
        # python 中 使用raise 抛出异常
        raise ValueError('Illegal value: %s' % n)
    return m/n
try:
    print(cal(10,0))
except Exception as  e:
    print(e)
finally:
    print("finally...")